import { dateFormat } from '@/util/date';
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01 00:00:00';
let now = new Date();
now.setDate(now.getDate() + 1);
export const endDate = dateFormat(now, 'yyyy-MM-dd')+ ' 00:00:00';
export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "editBtn": false,
  selection:true,
  // selectable: (row,index) => {
  //   return row.applyStatus == '0'
  // },
  "column": [
	  {
      "type": "input",
      "label": "序号",
      "prop": "id",
      hide:true,
      display:false,
    },		  {
      width:160,
      "type": "select",
      "label": "票卡类别",
      "prop": "ticketType",
      dicUrl:"/admin/dict/type/st_sw_tk_official_ticket",
      search:true,
      rules: [{
        message: '请选择票卡类别',
        trigger: 'blur'
      }]
    },  {
      width:160,
      "type": "select",
      "label": "工作类别",
      "prop": "workType",
      cascaderItem: ["issuingMethod"],
      dicUrl:"/admin/dict/type/day_plant_tasktype",
      rules: [{
        message: '请选择工作类别',
        trigger: 'blur'
      }]
    },  {
      width:160,
      "type": "select",
      "label": "发卡方式",
      "prop": "issuingMethod",
      props: {
        label: 'label',
        value: 'value'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictPlanAll/{{key}}',
      dicFlag: false,
      disabled: false
    }, {
      width:160,
      "type": "select",
      "label": "申请类别",
      "prop": "applyType",
      formslot:true,
      disabled:true,
      dicUrl:"/admin/dict/type/st_sw_tk_official_ticket_product_apply",
      search:true,
      rules: [{
        message: '请选择申请类别',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "次数",
      "prop": "count"
    },		  {
      width:180,
      "type": "date",
      "label": "申请时间",
      "prop": "applyTime",
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      rules: [{
        message: '请选择申请时间',
        trigger: 'blur'
      }]
    },		  {
      "type": "date",
      "label": "申请时间",
      "prop": "applyTimeDto",
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      search:true,
      searchValue: [startDate, endDate],
      searchRange: true,
      searchSpan: 12,
      hide: true,
      display: false
    },	  {
      width:160,
      "type": "input",
      "label": "票价",
      "prop": "money",
      rules: [{
        message: '请输入票价',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "有效期",
      "prop": "validityTime",
      rules: [{
        message: '请输入有效期',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "张数",
      "prop": "ticketNum",
      rules: [{
        message: '请输入张数',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "单位",
      "prop": "ticketUnit",
      hide:true,
      display:false,
    },	    {
      "type": "select",
      "label": "线路",
      "prop": "lineCode",
      cascaderItem: ["stationCode"],
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: "/support/swparamline/dict",
      search: true
      }, {
      "type": "select",
      "label": "站点",
      "prop": "stationCode",
      dicFlag: false,
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: "/support/swparamstation/dict/{{key}}",
      search: true
     },
    // {
    //   width:180,
    //   "type": "datetime",
    //   "label": "最晚启用",
    //   "prop": "lastStartTime",
    //   row:true,
    //   format: 'yyyy-MM-dd HH:mm:ss',
    //   valueFormat: 'yyyy-MM-dd HH:mm:ss',
    //   rules: [{
    //     message: '请选择最晚启用时间',
    //     trigger: 'blur'
    //   }]
    // },
    {
      width:200,
      "type": "textarea",
      "label": "申请原因",
      "prop": "applyCase",
      row:true,
      span:24,
      rules: [{
        message: '请输入申请原因',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "select",
      "label": "审批状态",
      "prop": "applyStatus",
      display:false,
      dicUrl:'/admin/dict/type/st_sw_tk_official_ticket_product_audit',
      search:true,
    },	  {
      width:180,
      "type": "input",
      "label": "审批时间",
      "prop": "auditTime",
      display:false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
    },	  {
      "type": "input",
      "label": "部门id",
      "prop": "deptId",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建人id",
      "prop": "creatorId",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建人",
      "prop": "creatorName",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "删除:1 未删除0",
      "prop": "delFlag",
      hide:true,
      display:false,
    }  ]
}


export const tableOptionView = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "editBtn": false,
  selection:true,
  // selectable: (row,index) => {
  //   return row.applyStatus == '0'
  // },
  "column": [
	  {
      "type": "input",
      "label": "序号",
      "prop": "id",
      hide:true,
      display:false,
    },		  {
      "type": "select",
      "label": "票卡类别",
      "prop": "ticketType",
      dicUrl:"/admin/dict/type/st_sw_tk_official_ticket",
      search:true,
      rules: [{
        message: '请选择票卡类别',
        trigger: 'blur'
      }]
    },  {
      "type": "select",
      "label": "工作类别",
      "prop": "workType",
      cascaderItem: ["issuingMethod"],
      dicUrl:"/admin/dict/type/day_plant_tasktype",
      rules: [{
        message: '请选择工作类别',
        trigger: 'blur'
      }]
    },   {
      "type": "select",
      "label": "发卡方式",
      "prop": "issuingMethod",
      props: {
        label: 'label',
        value: 'value'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictPlanAll/{{key}}',
      dicFlag: false,
    },  {
      "type": "select",
      "label": "申请类别",
      "prop": "applyType",
      formslot:true,
      disabled:true,
      dicUrl:"/admin/dict/type/st_sw_tk_official_ticket_product_apply",
      search:true,
      rules: [{
        message: '请选择申请类别',
        trigger: 'blur'
      }]
    },	  {
      "type": "input",
      "label": "次数",
      "prop": "count"
    },		  {
      "type": "datetime",
      "label": "申请时间",
      "prop": "applyTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      rules: [{
        message: '请选择申请时间',
        trigger: 'blur'
      }]
    },	  {
      "type": "input",
      "label": "票价",
      "prop": "money",
      rules: [{
        message: '请输入票价',
        trigger: 'blur'
      }]
    },	  {
      "type": "input",
      "label": "有效期",
      "prop": "validityTime",
      rules: [{
        message: '请输入有效期',
        trigger: 'blur'
      }]
    },	  {
      "type": "input",
      "label": "张数",
      "prop": "ticketNum",
      rules: [{
        message: '请输入张数',
        trigger: 'blur'
      }]
    },	  {
      "type": "input",
      "label": "单位",
      "prop": "ticketUnit",
      hide:true,
      display:false,
    },  {
      "type": "select",
      "label": "线路",
      "prop": "lineCode",
      cascaderItem: ["stationCode"],
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: "/support/swparamline/dict",
      search: true
      }, {
      "type": "select",
      "label": "站点",
      "prop": "stationCode",
      dicFlag: false,
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: "/support/swparamstation/dict/{{key}}",
      search: true
     },
    // {
    //   "type": "datetime",
    //   "label": "最晚启用",
    //   "prop": "lastStartTime",
    //   row:true,
    //   format: 'yyyy-MM-dd HH:mm:ss',
    //   valueFormat: 'yyyy-MM-dd HH:mm:ss',
    //   rules: [{
    //     message: '请选择最晚启用时间',
    //     trigger: 'blur'
    //   }]
    // },
    {
      "type": "textarea",
      "label": "申请原因",
      "prop": "applyCase",
      row:true,
      span:24,
      rules: [{
        message: '请输入申请原因',
        trigger: 'blur'
      }]
    },	  {
      "type": "select",
      "label": "审批状态",
      "prop": "applyStatus",
      display:false,
      dicUrl:'/admin/dict/type/st_sw_tk_official_ticket_product_audit',
      search:true,
    },	  {
      "type": "input",
      "label": "审批时间",
      "prop": "auditTime",
      display:false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
    },	{
      "type": "input",
      "label": "部门id",
      "prop": "deptId",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建人id",
      "prop": "creatorId",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建人",
      "prop": "creatorName",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "删除:1 未删除0",
      "prop": "delFlag",
      hide:true,
      display:false,
    }  ]
}

export const tableOptionEdit = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "viewBtn":false,
  "editBtn": false,
  selection:true,
  // selectable: (row,index) => {
  //   return row.applyStatus == '0'
  // },
  "column": [
	  {
      "type": "input",
      "label": "序号",
      "prop": "id",
      hide:true,
      display:false,
    },		  {
      width:160,
      "type": "select",
      "label": "票卡类别",
      "prop": "ticketType",
      dicUrl:"/admin/dict/type/st_sw_tk_official_ticket",
      search:true,
      rules: [{
        message: '请选择票卡类别',
        trigger: 'blur'
      }]
    },  {
      width:160,
      "type": "select",
      "label": "工作类别",
      "prop": "workType",
      cascaderItem: ["issuingMethod"],
      dicUrl:"/admin/dict/type/day_plant_tasktype",
      rules: [{
        message: '请选择工作类别',
        trigger: 'blur'
      }]
    },   {
      width:160,
      "type": "select",
      "label": "发卡方式",
      "prop": "issuingMethod",
      props: {
        label: 'label',
        value: 'value'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictPlanAll/{{key}}',
      dicFlag: false,
    },  {
      width:160,
      "type": "select",
      "label": "申请类别",
      "prop": "applyType",
      formslot:true,
      disabled:true,
      dicUrl:"/admin/dict/type/st_sw_tk_official_ticket_product_apply",
      search:true,
      rules: [{
        message: '请选择申请类别',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "次数",
      "prop": "count"
    },		  {
      width:180,
      "type": "datetime",
      "label": "申请时间",
      "prop": "applyTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      rules: [{
        message: '请选择申请时间',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "票价",
      "prop": "money",
      rules: [{
        message: '请输入票价',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "有效期",
      "prop": "validityTime",
      rules: [{
        message: '请输入有效期',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "张数",
      "prop": "ticketNum",
      rules: [{
        required: true,
        message: "请输入张数"
      }]
    },	  {
      width:160,
      "type": "input",
      "label": "单位",
      "prop": "ticketUnit",
      hide:true,
      display:false,
    },	     {
      "type": "select",
      "label": "线路",
      "prop": "lineCode",
      cascaderItem: ["stationCode"],
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: "/support/swparamline/dict",
      search: true
      }, {
      "type": "select",
      "label": "站点",
      "prop": "stationCode",
      dicFlag: false,
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: "/support/swparamstation/dict/{{key}}",
      search: true
     },
    // {
    //   width:180,
    //   "type": "datetime",
    //   "label": "最晚启用",
    //   "prop": "lastStartTime",
    //   row:true,
    //   format: 'yyyy-MM-dd HH:mm:ss',
    //   valueFormat: 'yyyy-MM-dd HH:mm:ss',
    //   rules: [{
    //     message: '请选择最晚启用时间',
    //     trigger: 'blur'
    //   }]
    // },
    {
      width:200,
      "type": "textarea",
      "label": "申请原因",
      "prop": "applyCase",
      row:true,
      span:24,
      rules: [{
        message: '请输入申请原因',
        trigger: 'blur'
      }]
    },	  {
      width:160,
      "type": "select",
      "label": "审批状态",
      "prop": "applyStatus",
      display:false,
      dicUrl:'/admin/dict/type/st_sw_tk_official_ticket_product_audit',
      search:true,
    },	  {
      width:200,
      "type": "input",
      "label": "审批时间",
      "prop": "auditTime",
      display:false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
    },	  {
      "type": "input",
      "label": "部门id",
      "prop": "deptId",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建人id",
      "prop": "creatorId",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建人",
      "prop": "creatorName",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      hide:true,
      display:false,
    },	  {
      "type": "input",
      "label": "删除:1 未删除0",
      "prop": "delFlag",
      hide:true,
      display:false,
    }  ]
}
